import { createMemoryHistory, createRouter } from 'vue-router'

import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

const routes = [
  { path: '/home', component: () => import('../views/HomeView.vue') },
  { path: '/pullList', component: () => import('../views/PullListView.vue') },
  { path: '/clickList', component: () => import('../views/ClickListView.vue') },
  { path: '/detail', component: () => import('../views/DetailView.vue') },
  { path: '/', component: () => import('../views/AdView.vue') },

]

const router = createRouter({
  history: createMemoryHistory(),
  routes,
})

router.beforeEach((to, from) => {
  NProgress.start()
})

router.afterEach((to, from) => {
  NProgress.done()
})

export default router
